package com.qut.graduate.busrtquery;

import com.qut.graduate.busrtquery.bean.BusInfoLineQuery;
import com.qut.graduate.busrtquery.bean.Route;
import com.qut.graduate.busrtquery.greendao.bean.BusLine;
import com.qut.graduate.busrtquery.greendao.bean.BusLineCollect;
import com.qut.graduate.busrtquery.greendao.bean.StationInfo;
import com.qut.graduate.busrtquery.greendao.bean.StationInfoCollect;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

/**
 * @Author WLL
 * @Time: 2019/4/29 9:53
 */
public class BRTQCache {

    private static BRTQCache mBRTQCache;

    public static BRTQCache getInstance() {
        if (null == mBRTQCache) {
            synchronized (BRTQCache.class) {
                if (null == mBRTQCache) {
                    mBRTQCache = new BRTQCache();
                }
            }
        }
        return mBRTQCache;
    }

    private BusInfoLineQuery busInfoLineQuery = null; // 当前线路查询的线路信息
    private BusLine busLine = null; // 当前线路查询界面点击的线路信息
    private Map<String, Route> mApiRoutesMap = new TreeMap<>(); // 存放所有的公交线路信息
    private int upRouteSize; // 上行的站点数量，用来计算下行站点的数量
    private int SQPoiSearchType; // 站点查询的类型，是第一次查询还是下拉加载更多查询建议
    private int SPPoiSearchType; // 选择地点的类型，是第一次查询还是下拉加载更多查询建议
    private List<BusLine> busLineHistoryList = new ArrayList<>(); // 存放所有公交线路历史记录
    private List<BusLineCollect> busLineCollectList = new ArrayList<>(); // 存放所有公交线路收藏记录
    private List<StationInfo> stationInfoHistoryList = new ArrayList<>(); // 存放所有站点的历史记录
    private List<StationInfoCollect> stationInfoCollectList = new ArrayList<>(); // 存放所有站点的收藏记录

    private List<BusLine> busLineHistoryListTemp = new ArrayList<>(); // 存放新添加的公交线路历史记录
    private List<BusLine> busLineCollectListTemp = new ArrayList<>(); // 存放新添加的公交线路收藏记录
    private List<StationInfo> stationInfoHistoryListTemp = new ArrayList<>(); // 存放新添加的站点的历史记录
    private List<StationInfo> stationInfoCollectListTemp = new ArrayList<>(); // 存放新添加的站点的收藏记录

    public Map<String, Route> getmApiRoutesMap() {
        return mApiRoutesMap;
    }

    public void setmApiRoutesMap(Map<String, Route> mApiRoutesMap) {
        this.mApiRoutesMap = mApiRoutesMap;
    }

    public BusLine getBusLine() {
        return busLine;
    }

    public void setBusLine(BusLine busLine) {
        this.busLine = busLine;
    }

    public BusInfoLineQuery getBusInfoLineQuery() {
        return busInfoLineQuery;
    }

    public void setBusInfoLineQuery(BusInfoLineQuery busInfoLineQuery) {
        this.busInfoLineQuery = busInfoLineQuery;
    }

    public int getUpRouteSize() {
        return upRouteSize;
    }

    public void setUpRouteSize(int upRouteSize) {
        this.upRouteSize = upRouteSize;
    }

    public int getSQPoiSearchType() {
        return SQPoiSearchType;
    }

    public void setSQPoiSearchType(int SQPoiSearchType) {
        this.SQPoiSearchType = SQPoiSearchType;
    }

    public int getSPPoiSearchType() {
        return SPPoiSearchType;
    }

    public void setSPPoiSearchType(int SPPoiSearchType) {
        this.SPPoiSearchType = SPPoiSearchType;
    }

    public List<BusLine> getBusLineHistoryList() {
        return busLineHistoryList;
    }

    public void setBusLineHistoryList(List<BusLine> busLineHistoryList) {
        this.busLineHistoryList = busLineHistoryList;
    }

    public List<BusLineCollect> getBusLineCollectList() {
        return busLineCollectList;
    }

    public void setBusLineCollectList(List<BusLineCollect> busLineCollectList) {
        this.busLineCollectList = busLineCollectList;
    }

    public List<StationInfo> getStationInfoHistoryList() {
        return stationInfoHistoryList;
    }

    public void setStationInfoHistoryList(List<StationInfo> stationInfoHistoryList) {
        this.stationInfoHistoryList = stationInfoHistoryList;
    }

    public List<StationInfoCollect> getStationInfoCollectList() {
        return stationInfoCollectList;
    }

    public void setStationInfoCollectList(List<StationInfoCollect> stationInfoCollectList) {
        this.stationInfoCollectList = stationInfoCollectList;
    }

}
